from langchain.llms import OpenAI
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain

client = OpenAI(
    api_key='hk-mtiquv1000041663a49a34520ad3294132cbce7abf1c2ef3',
    base_url="https://api.openai-hk.com/v1"
)
prompt_tpl = PromptTemplate.from_template('请给讲1个关于{type}的笑话')
chain = LLMChain(llm = client,prompt = prompt_tpl)
#inputs  apply
print(chain.run('程序员'))